/**
 *
 */
package Start;

import java.util.Vector;

/**
 * @author Jake
 *
 */
public class Q7 {
	static int [][]mountain;
	static int C;
	static int R;

	
    public static void main(String[] args) {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
    Foo answer;
    Foo temp;
    Vector<coord> soln = new Vector<coord>(); 
    
	mountain = new int[R][C];

	
	/*
	 * fill in the mountain
	 */
	
	
	for(int i =0; i < R; i++){
		if(i==0){
		answer = Path(i,0,0,null);
		}
		else{
			
		if(){
			
		}
		}
	}
    
    
    }
	
    
    public static Foo Path(int col, int row, int trisk, Vector<coord> soln){
    	int c = col;
    	int r = row + 1;
    	int risk = trisk;
    	coord hold;
    	Vector<coord> sln = soln;
    	if(R == row){
    		Foo kung = new Foo(risk,soln);
    		return kung; 		
    	}
    	else{
    		if(c == 0){
    			if(mountain[r][c] <= mountain[r][c+1]){
    				risk += mountain[r][c];
    				hold = new coord(r,c);
    				sln.add(hold);
    			}
    			else{
    				risk += mountain[r][c+1];
    				hold = new coord(r,c+1);
    				sln.add(hold);
    				c=c+1;
    			}
    		}
    		else if(c == C){
    			if(mountain[r][c-1] <= mountain[r][c]){
    				risk += mountain[r][c-1];
    				hold = new coord(r,c-1);
    				sln.add(hold);
    				c=c-1;
    			}
    			else{
    				risk += mountain[r][c];
    				hold = new coord(r,c);
    				sln.add(hold);
    			}
    		}
    		else{
    			if(mountain[r][c-1] <= mountain[r][c]){
    				if(mountain[r][c-1] <= mountain[r][c+1]){
    				risk += mountain[r][c-1];
    				hold = new coord(r,c-1);
    				sln.add(hold);
    				c=c-1;
    				}
    				else{
        				risk += mountain[r][c+1];
        				hold = new coord(r,c+1);
        				sln.add(hold);
    				c=c+1;
    				}
    			}
    			else if(mountain[r][c-1] > mountain[r][c]){
    				if(mountain[r][c] <= mountain[r][c+1]){
        				risk += mountain[r][c];
        				hold = new coord(r,c);
        				sln.add(hold);
    				}
    				else{
        				risk += mountain[r][c+1];
        				hold = new coord(r,c+1);
        				sln.add(hold);
        				c=c+1;
    				}
    			}
    		}	
    		
    		Path(c,r,risk,sln);   		
    	}
		return null;
    }
    
    
	
	
	
}

class coord{
	public int C;
	public int R;
	
	coord(int cols, int rows){
		C = cols;
		R = rows;
	}

	/**
	 * @return the c
	 */
	public int getC() {
		return C;
	}

	/**
	 * @param c - used to set c
	 */
	public void setC(int c) {
		C = c;
	}

	/**
	 * @return the r
	 */
	public int getR() {
		return R;
	}

	/**
	 * @param r - used to set r
	 */
	public void setR(int r) {
		R = r;
	}
}
	
class Foo{
	public int risk;
	public Vector<coord> sln;
	/**
	 * @param risk
	 * @param sln
	 */
	Foo(int risk, Vector<coord> sln) {
		this.risk = risk;
		this.sln = sln;
	}
	/**
	 * @return the risk
	 */
	public int getRisk() {
		return risk;
	}
	/**
	 * @param risk - used to set risk
	 */
	public void setRisk(int risk) {
		this.risk = risk;
	}
	/**
	 * @return the sln
	 */
	public Vector<coord> getSln() {
		return sln;
	}
	/**
	 * @param sln - used to set sln
	 */
	public void setSln(Vector<coord> sln) {
		this.sln = sln;
	}
		
}
	
	
